#include<stdio.h>
#include"person.h"
int main()
{
	Person* px = new Person(25);
	px->sayHello();
	delete px;

	Person p(12);
	Person *p2 = &p;
	p2->sayHello();

	printf("p2->getAge() = %d \n", p2->getAge());

	Person **pp = &p2;
	printf("%p\n", &p); // 0x7fff594435f0
	printf("%p\n", p2); // 0x7fff594435f0
	printf("%p\n", *pp); // 0x7fff594435f0
	printf("%p\n", pp);
	printf("(*pp)->getAge() > %d\n", (*pp)->getAge()); // 12
	
	printf("%ld\n",sizeof(p)); // 16
	printf("%ld\n",sizeof(*p2)); // 16
	printf("%ld\n",sizeof(**pp)); // 16
	printf("%ld\n",sizeof(p2)); // 8
	printf("%ld\n",sizeof(pp)); // 8
	return 0;
}

void Person::sayHello() {
	printf("Hello I'm %d years old\n", age);
}

int Person::getAge() {
	return age;
}

